package upbeat.types;

public class Measure {
	public static final Measure REST = new Measure("REST", 0);
	
	String midifileName;
	int measure;
	private int volume = 100;
	private int pitch = 0;
	private int instrument = 0;
	private int channel = 0;
	
	private boolean ready = false;
	
	public Measure(String fileName, int measure) {
		this.midifileName = fileName;
		this.measure = measure + 1;
	}
	
	public String toString() {
		return String.format("%s, M:%d V:%d P:%d I:%d", midifileName, measure, volume, pitch, instrument);
	}
	
	public void setChannel(int chan) {
		channel = chan;
	}
	
	public int getChannel() {
		return channel;
	}

	public void setInstrument(int instrument) {
		this.instrument = instrument;
	}
	
	public int getInstrument() {
		return instrument;
	}

	public void setPitch(int pitch) {
		this.pitch = pitch;
	}


	public int getPitch() {
		return pitch;
	}

	public void setVolume(int volume) {
		this.volume = volume;
	}

	public int getVolume() {
		return volume;
	}
	
	public String getMidiName() {
		return midifileName;
	}
	
	public int getMeasure() {
		return measure;
	}

	public void setIsReady(boolean ready) {
		this.ready = ready;
	}
	
	public boolean getIsReady() {
		return ready;
	}
}
